import { Body, Controller, Get, Post, Res } from "@nestjs/common"
import { PiracyService } from "./piracy.service"

@Controller("piracy")
export class PiracyController {
  constructor(private readonly piracyService: PiracyService) {}
  // Obtain all piracy information
  @Get("/getAll")
  async getAll(@Res() res: object): Promise<void> {
    return await this.piracyService.getAll(res)
  }

  // Search piracy information
  @Post("/search")
  async search(@Res() res: object, @Body() body: object): Promise<void> {
    return this.piracyService.search(body, res)
  }

  // Real deletion piracy information
  @Post("/delete")
  async delete(@Res() res: object, @Body() body: object): Promise<void> {
    return this.piracyService.delete(body, res)
  }

  // Batch real deletion piracy information
  @Post("/deleteGroup")
  async deleteGroup(@Res() res: object, @Body() body: object): Promise<void> {
    return this.piracyService.deleteGroup(body, res)
  }
}
